<template>
	<view>
		<daya-footer-navbar menu_type="waimai" />
		<u-navbar title="外卖">
		</u-navbar>
		<view class="page" :style="{paddingTop: top + 44 + 'px'}">
			<view class="head">
				<view @tap="selectednavbar" class="topnav" :data-index="index" v-for="(item, index) in topnav"
					:key="index">
					<!-- <view class="topimg" :style="'background:' + (selectedindex == index ? '#fff' : '')">
						<image mode="widthFix" :src="item.img1" v-if="selectedindex == index"></image>
						<image mode="widthFix" :src="item.img" v-else></image>
					</view> -->

					<view :class="selectedindex == index ? 'active item' : 'item'">{{ item.name }}</view>
				</view>
			</view>
			<view class="main">
				<view class="no-data-tip zwdd" v-if="order_list.length == 0 && mygd">
					<image mode="aspectFit" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/list.png">
					</image>
					<view>您暂无相关订单哦~</view>
				</view>
				<navigator class="weui-cells weui-cells_after-title list-item" hoverClass="none"
					:url="'wmddxq?oid=' + oitem.order.id" v-for="(oitem, oindex) in order_list" :key="oindex">
					<view class="weui-cell" style="padding: 20rpx 30rpx 0rpx">
						<view class="weui-cell__hd ddxh tips">#{{ oitem.order.oid }}</view>
						<view class="weui-cell__bd">
							<view>{{ oitem.order.name }}</view>
						</view>
					</view>
					<!-- <view>下单时间：{{ oitem.order.time }}
					</view> -->

					<view @tap.stop.prevent="location" class="weui-cell" :data-address="oitem.order.address"
						:data-lat="oitem.order.lat" :data-lng="oitem.order.lng" v-if="oitem.order.order_type == '1'">
						<view class="weui-cell__hd">收货地址：</view>
						<view class="weui-cell__bd">{{ oitem.order.address }}</view>
						<view class="weui-cell__ft">
							<image mode="aspectFit"
								src="https://ymqycc.oss-cn-chengdu.aliyuncs.com/ymqzho2o/static/icon/address.png">
							</image>
						</view>
					</view>

					<view class="weui-cell">
						<view class="weui-cell__hd" v-if="oitem.order.order_type == '1'">配送时间：</view>
						<view class="weui-cell__hd" v-if="oitem.order.order_type == '2'">自提时间：</view>
						<view class="weui-cell__bd" :style="'color:' + color">{{
              oitem.order.delivery_time
            }}</view>
						<view class="weui-cell__ft" :style="'color:' + color" v-if="oitem.order.order_type == '1'">
							{{ oitem.order.ps_mode }}
						</view>
						<view @tap.stop.prevent="psxq" class="weui-cell__ft dyxp" :data-id="oitem.order.id"
							:data-psmode="oitem.order.ps_mode" :data-sjid="oitem.order.store_id" :style="
                'color:#fff;border-color:#fff;background:' +
                color +
                ';margin-left:20rpx;'
              " v-if="
                oitem.order.state == '3' &&
                oitem.order.order_type == '1' &&
                oitem.order.ps_mode != '商家配送' &&
                oitem.order.ps_mode != '快服务配送'
              ">
							配送详情
						</view>
					</view>

					<!-- <view @tap.stop.prevent="kindToggle" class="weui-cell" :id="oindex">
						<view class="weui-cell__hd">商品信息：</view>
						<view class="weui-cell__bd" style="color: #999; font-size: 22rpx">
							{{ oitem.good[0].name }}等{{ oitem.num }}件商品
						</view>
						<view class="weui-cell__ft">
							<image :class="oitem.open ? 'xs' : 'xx'" mode="aspectFit"
								src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/down1.png"></image>
						</view>
					</view> -->

					<!-- <view class="weui-cell" v-if="oitem.open" v-for="(item, index) in oitem.good" :key="index">
						<view class="weui-cell__hd">
							<image :src="item.img"></image>
						</view>

						<view class="weui-cell__bd">{{ item.name }}</view>

						<view class="weui-cell__ft cpjg">
							<text>x{{ item.number }}</text>
							￥{{ item.money }}
						</view>
					</view> -->

					<!-- <view @tap.stop.prevent="maketel" class="weui-cell" :data-tel="oitem.order.tel">
						<view class="weui-cell__hd">订单金额：</view>
						<view class="weui-cell__bd" :style="'color:' + color">{{ oitem.order.money }}元</view>
						<view class="weui-cell__ft" style="color: #66cd00" v-if="oitem.order.pay_type == '1'">微信支付
						</view>
						<view class="weui-cell__ft" style="color: #eead0e" v-if="oitem.order.pay_type == '2'">余额支付
						</view>
						<view class="weui-cell__ft" v-if="oitem.order.pay_type == '4'">货到付款</view>
					</view> -->
					
					<view class="ddbh">
						<view>订单编号：{{ oitem.order.order_num }}</view>
						<view @tap.stop.prevent="dyxp" class="xp" :data-id="oitem.order.id">
							打印小票
						</view>
						<view class="status">
							<view class="weui-cell__ft" v-if="oitem.order.state == '2'">等待商家接单
							</view>
							<view class="weui-cell__ft"
								v-if="oitem.order.state == '3' && oitem.order.order_type == '1'">等待送达</view>
							<view class="weui-cell__ft"
								v-if="oitem.order.state == '3' && oitem.order.order_type == '2'">等待客户自提</view>
							<view class="weui-cell__ft" v-if="oitem.order.state == '4' || oitem.order.state == '5'">
								订单已完成</view>
							<view class="weui-cell__ft" v-if="oitem.order.state == '6'">客户已取消
							</view>
							<view class="weui-cell__ft" style="color: #ff4544" v-if="oitem.order.state == '7'">商家拒绝接单
							</view>
							<view class="weui-cell__ft" v-if="oitem.order.state == '8'">客户申请退款
							</view>
							<view class="weui-cell__ft" v-if="oitem.order.state == '9'">商家已退款
							</view>
							<view class="weui-cell__ft" style="color: #ff4544" v-if="oitem.order.state == '10'">商家拒绝退款
							</view>
						</view>
					</view>
					<view class="good-list">
						<view @tap.stop.prevent="kindToggle" class="weui-cell" :id="oindex">
							<view class="weui-cell__hd">商品信息：</view>
							<view class="weui-cell__bd" style="color: #999; font-size: 22rpx">
								{{ oitem.good[0].name }}等{{ oitem.num }}件商品
							</view>
							<view class="weui-cell__ft" v-if="oitem.good.length > 1">
								<image :class="isFold ? 'xs' : 'xx'" mode="aspectFit"
									src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/down1.png"></image>
							</view>
						</view>
						<view :style="{height: isFold ? '40px' : 'auto',overflow: 'hidden'}">
							<view class="goods-item" v-for="ele in oitem.good">
								<image :src="ele.img" mode=""></image>
								<text class="name">{{ele.name}}</text>
								<view class="money">
									<text class="price">￥{{ele.money}}</text>
									<text class="num">x{{ele.number}}</text>
								</view>
							</view>
						</view>
					</view>
					<view class="bottom">
						<view class="left">
							<view class="total">
								<view>合计 ￥ <text>{{oitem.order.money}}</text> </view>
								<text class="time">{{oitem.order.time}}</text>
							</view>
						</view>
						<view class="options-btn">
							<button @tap.stop.prevent="jjjd" class="jjjd" :data-id="oitem.order.id"
								v-if="oitem.order.state == '2'">
								拒绝接单
							</button>
							<button @tap.stop.prevent="djjd" class="djjd" :data-id="oitem.order.id" v-if="oitem.order.state == '2'">
								点击接单
							</button>
							<button @tap.stop.prevent="wcps" class="djjd" :data-id="oitem.order.id"
								:style="'background:' + color + ';color: #fff;'"
								v-if="oitem.order.state == '3' && oitem.order.order_type == '1'">
								完成订单
							</button>
							
							<!-- @tap.stop.prevent="smhx" 扫码核销 -->
							<!-- @tap.stop.prevent="codehx" 输码核销 -->
							<button @tap.stop.prevent="codehx" class="djjd" :data-id="oitem.order.id"
								:style="'background:' + color + ';color: #fff;'"
								v-if="oitem.order.state == '3' && oitem.order.order_type == '2'">
								验证核销码
							</button>
							<button @tap.stop.prevent="jjtk" class="jjjd" :data-id="oitem.order.id"
								v-if="oitem.order.state == '8'">
								拒绝退款
							</button>
							<button @tap.stop.prevent="tgtk" class="djjd" :data-id="oitem.order.id"
								:style="'background:' + color + ';color: #fff;'" v-if="oitem.order.state == '8'">
								通过退款
							</button>
						</view>
					</view>
					

					<!-- <view class="ddxx">
						<view class="flex-bet">
							<view>订单编号：{{ oitem.order.order_num }}</view>
							<view @tap.stop.prevent="dyxp" class="dyxp" :data-id="oitem.order.id">
								打印小票
							</view>
						</view>
						<view v-if="oitem.order.note != ''">备注：{{ oitem.order.note }}</view>
					</view> -->

					<!-- <view class="footbtn">
						<button @tap.stop.prevent="jjjd" class="jjjd" :data-id="oitem.order.id"
							v-if="oitem.order.state == '2'">
							拒绝接单
						</button>
						<button @tap.stop.prevent="djjd" class="djjd" :data-id="oitem.order.id"
							:style="'background:' + color + ';color: #fff;'" v-if="oitem.order.state == '2'">
							点击接单
						</button>
						<button @tap.stop.prevent="wcps" class="djjd" :data-id="oitem.order.id"
							:style="'background:' + color + ';color: #fff;'"
							v-if="oitem.order.state == '3' && oitem.order.order_type == '1'">
							完成订单
						</button>

						@tap.stop.prevent="smhx" 扫码核销
						@tap.stop.prevent="codehx" 输码核销
						<button @tap.stop.prevent="codehx" class="djjd" :data-id="oitem.order.id"
							:style="'background:' + color + ';color: #fff;'"
							v-if="oitem.order.state == '3' && oitem.order.order_type == '2'">
							验证核销码
						</button>
						<button @tap.stop.prevent="jjtk" class="jjjd" :data-id="oitem.order.id"
							v-if="oitem.order.state == '8'">
							拒绝退款
						</button>
						<button @tap.stop.prevent="tgtk" class="djjd" :data-id="oitem.order.id"
							:style="'background:' + color + ';color: #fff;'" v-if="oitem.order.state == '8'">
							通过退款
						</button>
					</view> -->
				</navigator>
				<view class="jzz" v-if="!mygd">
					<image class="Rotation" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/jzz.png"></image>
					<view>加载中...</view>
				</view>
				<view class="jzwb" v-if="mygd">
					<view class="hx"></view>
					<view class="wz">加载完毕</view>
					<view class="hx"></view>
				</view>
			</view>
		</view>
		<view @tap="hideFun" :class="'flex-row flex-y-center modal1 ' + (hide == 1 ? 'hide' : '')">
			<view class="flex-y-center" style="width: 100%; padding: 125rpx">
				<view style="
            background-color: #fff;
            width: 100%;
            height: 100%;
            border-radius: 10rpx;
            padding: 30rpx 30rpx;
          ">
					<view class="flex-x-center" style="width: 100%; height: 50rpx; margin: 20rpx 0; font-size: 13pt">
						配送信息</view>
					<block v-if="psmode == '达达配送'">
						<view class="weui-cells weui-cells_after-title">
							<view class="weui-cell">
								<view class="weui-cell__hd">配送状态：</view>
								<view class="weui-cell__bd" v-if="psxx.result.statusCode == '1'">待取货</view>
								<view class="weui-cell__bd" v-if="psxx.result.statusCode == '2'">配送中</view>
								<view class="weui-cell__bd" v-if="psxx.result.statusCode == '3'">已完成</view>
								<view class="weui-cell__bd" v-if="psxx.result.statusCode == '4'">已取消</view>
								<view class="weui-cell__bd" v-if="psxx.result.statusCode == '5'">已过期</view>
							</view>
						</view>
						<view class="weui-cells weui-cells_after-title">
							<view class="weui-cell">
								<view class="weui-cell__hd">配送骑手：</view>
								<view class="weui-cell__bd">{{
                  psxx.result.transporterName
                }}</view>
							</view>
						</view>
						<view class="weui-cells weui-cells_after-title">
							<view @tap.stop.prevent="maketel" class="weui-cell"
								:data-tel="psxx.result.transporterPhone">
								<view class="weui-cell__hd">联系电话：</view>
								<view class="weui-cell__bd">{{
                  psxx.result.transporterPhone
                }}</view>
								<view class="weui-cell__ft">
									<image mode="aspectFit"
										src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/lxsj.png"></image>
								</view>
							</view>
						</view>
					</block>
					<block v-if="psmode != '达达配送'">
						<view class="weui-cells weui-cells_after-title">
							<view class="weui-cell">
								<view class="weui-cell__hd">配送状态：</view>
								<view class="weui-cell__bd" v-if="psxx.rst.state == '1'">待接单</view>
								<view class="weui-cell__bd" v-if="psxx.rst.state == '2'">已接单</view>
								<view class="weui-cell__bd" v-if="psxx.rst.state == '3'">已取货</view>
							</view>
						</view>
						<view class="weui-cells weui-cells_after-title">
							<view class="weui-cell">
								<view class="weui-cell__hd">配送骑手：</view>
								<view class="weui-cell__bd">{{ psxx.rst.name }}</view>
							</view>
						</view>
						<view class="weui-cells weui-cells_after-title">
							<view @tap.stop.prevent="maketel" class="weui-cell" :data-tel="psxx.rst.tel">
								<view class="weui-cell__hd">联系电话：</view>
								<view class="weui-cell__bd">{{ psxx.rst.tel }}</view>
								<view class="weui-cell__ft">
									<image mode="aspectFit"
										src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/lxsj.png"></image>
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
		</view>

		<mi-payKeyboard v-if="show_hx_keyboard" @close="show_hx_keyboard=false" @success="hx_event"
			title="核销键盘"></mi-payKeyboard>
	</view>
</template>

<script>
	import cardlist from '@/ymq_canyino2o/dist/cardlist/index'
	import gettel from '@/ymq_canyino2o/dist/gettel/index'
	var dsq
	var app = getApp()
	var siteinfo = require('../../../../siteinfo.js');
	export default {
		components: {
			cardlist,
			gettel
		},
		data() {
			return {
				show_hx_keyboard: false,
				selectedindex: 0,

				topnav: [{
						img: '../static/icon/djd.png',
						img1: '../static/icon/wdjd.png',
						name: '待接单'
					},
					{
						img: '../static/icon/dps.png',
						img1: '../static/icon/wdps.png',
						name: '待送达'
					},
					{
						img: '../static/icon/dzt.png',
						img1: '../static/icon/wdzt.png',
						name: '待自提'
					},
					{
						img: '../static/icon/ywc.png',
						img1: '../static/icon/wywc.png',
						name: '已完成'
					},
					{
						img: '../static/icon/sh.png',
						img1: '../static/icon/wsh.png',
						name: '售后/退款'
					}
				],

				open: false,
				pagenum: 1,
				order_list: [],
				storelist: [],
				mygd: false,
				jzgd: true,
				hide: 1,
				xtxx: '',

				psxx: {
					result: {
						statusCode: '',
						transporterName: '',
						transporterPhone: ''
					},

					rst: {
						state: '',
						name: '',
						tel: ''
					}
				},

				psmode: '',
				status: '',


				color: '',

				oitem: {
					order: {
						id: '',
						oid: '',
						name: '',
						state: '',
						order_type: '',
						time: '',
						address: '',
						lat: '',
						lng: '',
						delivery_time: '',
						ps_mode: '',
						store_id: '',
						tel: '',
						money: '',
						pay_type: '',
						order_num: '',
						note: ''
					},

					good: '',
					num: '',
					open: false
				},

				oindex: 0,
				name: '',
				top: 0,
				isFold: true
			}
		},
		onLoad: function(t) {
			this.top = uni.getSystemInfoSync().statusBarHeight
			var that = this
			var a = uni.getStorageSync('sjdsjid')
			var o = siteinfo.siteroot.replace('app/index.php', '')
			console.log(a, o)
			this.reLoad()
			app.globalData.setNavigationBarColor(this)
			app.globalData.sjdappPageOnLoad(this)
			app.globalData.util.request({
				url: 'entry/wxapp/system',
				cachetime: '0',
				success: function(t) {
					console.log(t.data)
					uni.setStorageSync('system', t.data)
					uni.setNavigationBarTitle({
						title: t.data.wm_name || '外卖'
					})
					that.setData({
						xtxx: t.data
					})
				}
			})
			dsq = setInterval(function() {
				if (uni.getStorageSync('yybb')) {
					app.globalData.util.request({
						url: 'entry/wxapp/NewOrder',
						cachetime: '0',
						data: {
							store_id: a
						},
						success: function(t) {
							console.log(t)
							if (1 == t.data) {
								uni.playBackgroundAudio({
									dataUrl: o +
										'addons/ymq_canyino2o/template/images/wm.wav',
									title: '语音播报'
								})
							}
							if (2 == t.data) {
								uni.playBackgroundAudio({
									dataUrl: o +
										'addons/ymq_canyino2o/template/images/dn.wav',
									title: '语音播报'
								})
							}
						}
					})
				} else {
					clearInterval(dsq)
				}
			}, 10000)
		},
		onReady: function() {},
		onShow: function() {},
		onHide: function() {},
		onUnload: function() {
			clearInterval(dsq)
		},
		onPullDownRefresh: function() {},
		onReachBottom: function() {
			console.log('上拉加载', this.pagenum)
			if (!this.mygd && this.jzgd) {
				this.setData({
					jzgd: false
				})
				this.reLoad()
			}
		},
		methods: {
			hideFun: function(t) {
				this.setData({
					hide: 1
				})
			},

			psxq: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				var o = t.currentTarget.dataset.sjid
				var n = t.currentTarget.dataset.psmode
				console.log(a, o, n)
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				app.globalData.util.request({
					url: 'entry/wxapp/GetStorePsInfo',
					cachetime: '0',
					data: {
						store_id: o,
						order_id: a
					},
					success: function(t) {
						console.log(t.data)
						if ('达达配送' != n || null != t.data.result) {
							that.setData({
								psxx: t.data,
								psmode: n,
								hide: 2
							})
						} else {
							uni.showModal({
								title: '提示',
								content: '配送信息异常' + t.data
							})
						}
					}
				})
			},

			maketel: function(t) {
				var e = t.currentTarget.dataset.tel
				uni.makePhoneCall({
					phoneNumber: e
				})
			},

			location: function(t) {
				var e = t.currentTarget.dataset.lat
				var a = t.currentTarget.dataset.lng
				var o = t.currentTarget.dataset.address
				console.log(e, a)
				uni.openLocation({
					latitude: parseFloat(e),
					longitude: parseFloat(a),
					address: o,
					name: '位置'
				})
			},

			selectednavbar: function(t) {
				console.log(t)
				this.setData({
					pagenum: 1,
					order_list: [],
					storelist: [],
					mygd: false,
					jzgd: true,
					selectedindex: t.currentTarget.dataset.index,
					status: Number(t.currentTarget.dataset.index) + 1
				})
				this.reLoad()
			},

			doreload: function(t) {
				console.log(t)
				this.setData({
					pagenum: 1,
					order_list: [],
					storelist: [],
					mygd: false,
					jzgd: true,
					selectedindex: t - 1,
					status: t
				})
				this.reLoad()
			},

			kindToggle: function(t) {
				this.isFold = !this.isFold
				var e = t.currentTarget.id
				var a = this.order_list
				console.log(e)
				for (var o = 0, n = a.length; o < n; ++o) {
					a[o].open = o == e && !a[o].open
				}
				this.setData({
					order_list: a
				})
			},

			reLoad: function() {
				var t
				var that = this
				var e = this.status || 1
				var o = uni.getStorageSync('sjdsjid')
				var n = this.pagenum
				var s = ''
				if (1 == e) {
					t = '2'
				}
				if (2 == e) {
					t = '3'
					s = '2'
				}
				if (3 == e) {
					t = '3'
					s = '1'
				}
				if (4 == e) {
					t = '4,5'
				}
				if (5 == e) {
					t = '6,7,8,9,10'
				}
				console.log(e, t, s, o, n)
				app.globalData.util.request({
					url: 'entry/wxapp/StoreWmOrder',
					cachetime: '0',
					data: {
						state: t,
						zt: s,
						store_id: o,
						page: n,
						pagesize: 10
					},
					success: function(t) {
						console.log('分页返回的列表数据', t.data)
						if (t.data.length < 10) {
							that.setData({
								mygd: true,
								jzgd: true
							})
						} else {
							that.setData({
								jzgd: true,
								pagenum: that.pagenum + 1
							})
						}
						var e = that.storelist
						e = (function(t) {
							for (var e = [], a = 0; a < t.length; a++) {
								if (-1 == e.indexOf(t[a])) {
									e.push(t[a])
								}
							}
							return e
						})((e = e.concat(t.data)))
						that.setData({
							order_list: e,
							storelist: e
						})
						console.log(e)
					}
				})
			},

			smhx: function(t) {
				var a = uni.getStorageSync('sjdsjid')
				uni.scanCode({
					success: function(t) {
						console.log(t)
						var e = '/' + t.path
						uni.navigateTo({
							url: e + '&storeid=' + a
						})
					},
					fail: function(t) {
						console.log('扫码fail')
					}
				})
			},

			hx_event(hx_code) {
				console.log("hx_code", hx_code)
				this.show_hx_keyboard = false
				var store_id = uni.getStorageSync('sjdsjid')
				app.globalData.util.request({
					url: 'entry/wxapp/store_hx_code',
					cachetime: '0',
					data: {
						store_id: store_id,
						hx_code: hx_code
					},
					success: (res) => {
						if (res.data.code == 1) {
							uni.navigateTo({
								url: '/ymq_canyino2o/pages/sjzx/hx?storeid=' + store_id + '&scene=' +
									res.data.data['store_id'] + "," + res.data.data['id']
							})
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							})
						}
					}
				})

				// 弹出一个输入框,让用户输入核销码,点击确定后,请求url进行核销验证
				//
				// app.globalData.util.request({
				//   url: 'entry/wxapp/StoreWmOrderhx',
				//   cachetime: '0',
				//   data: {
				//     order_id: a
				//   },
				//   success: function (t) {
				//     console.log(t.data)
				//     if ('核销成功' == t.data) {
				//       uni.showToast({
				//         title: '核销成功',
				//         icon: 'success',
				//         duration: 1e3
				//       })
				//       setTimeout(function () {
				//         uni.redirectTo({
				//           url: '../distribution/order'
				//         })
				//       }, 1e3)
				//     }
				//     if ('核销失败' == t.data) {
				//       uni.showToast({
				//         title: '核销失败',
				//         icon: 'loading',
				//         duration: 1e3
				//       })
				//     }
				//   }
				// })

			},
			codehx: function(t) {
				//商店id
				var a = uni.getStorageSync('sjdsjid')
				this.show_hx_keyboard = true
			},

			dyxp: function(t) {
				var e = t.currentTarget.dataset.id
				console.log(e)
				uni.showModal({
					title: '提示',
					content: '是否确认打印此订单小票？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/QtPrint',
								cachetime: '0',
								data: {
									order_id: e,
									type: 1
								},
								success: function(t) {
									console.log(t.data)
									uni.showToast({
										title: '操作成功',
										icon: 'success',
										duration: 1000
									})
								}
							})
						}
					}
				})
			},

			djjd: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				console.log(a)
				uni.showModal({
					title: '提示',
					content: '是否确认接单？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/JdOrder',
								cachetime: '0',
								data: {
									order_id: a
								},
								success: function(t) {
									console.log(t.data)
									if ('1' == t.data) {
										uni.showToast({
											title: '接单成功',
											icon: 'success',
											duration: 1000
										})
										setTimeout(function() {
											that.doreload(2)
										}, 1000)
									} else {
										uni.showToast({
											title: '请重试',
											icon: 'loading',
											duration: 1000
										})
									}
								}
							})
						}
					}
				})
			},

			jjjd: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				console.log(a)
				uni.showModal({
					title: '提示',
					content: '是否拒绝接单？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/JjOrder',
								cachetime: '0',
								data: {
									order_id: a
								},
								success: function(t) {
									console.log(t.data)
									if ('1' == t.data) {
										uni.showToast({
											title: '操作成功',
											icon: 'success',
											duration: 1000
										})
										setTimeout(function() {
											that.doreload(5)
										}, 1000)
									} else {
										uni.showToast({
											title: '请重试',
											icon: 'loading',
											duration: 1000
										})
									}
								}
							})
						}
					}
				})
			},

			wcps: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				console.log(a)
				uni.showModal({
					title: '提示',
					content: '确认完成此订单？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/OkOrder',
								cachetime: '0',
								data: {
									order_id: a
								},
								success: function(t) {
									console.log(t.data)
									if ('1' == t.data) {
										uni.showToast({
											title: '操作成功',
											icon: 'success',
											duration: 1000
										})
										setTimeout(function() {
											that.doreload(4)
										}, 1000)
									} else {
										uni.showToast({
											title: '请重试',
											icon: 'loading',
											duration: 1000
										})
									}
								}
							})
						}
					}
				})
			},

			jjtk: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				console.log(a)
				uni.showModal({
					title: '提示',
					content: '是否拒绝退款？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/JjTk',
								cachetime: '0',
								data: {
									order_id: a
								},
								success: function(t) {
									console.log(t.data)
									if ('1' == t.data) {
										uni.showToast({
											title: '操作成功',
											icon: 'success',
											duration: 1000
										})
										setTimeout(function() {
											that.doreload(5)
										}, 1000)
									} else {
										uni.showToast({
											title: '请重试',
											icon: 'loading',
											duration: 1000
										})
									}
								}
							})
						}
					}
				})
			},

			tgtk: function(t) {
				var that = this
				var a = t.currentTarget.dataset.id
				console.log(a)
				uni.showModal({
					title: '提示',
					content: '是否通过退款？',
					cancelText: '否',
					confirmText: '是',
					success: function(t) {
						if (t.cancel) {
							return true
						}
						if (t.confirm) {
							uni.showLoading({
								title: '操作中',
								mask: true
							})
							app.globalData.util.request({
								url: 'entry/wxapp/TkTg',
								cachetime: '0',
								data: {
									order_id: a
								},
								success: function(t) {
									console.log(t.data)
									if ('1' == t.data) {
										uni.showLoading({
											title: '操作中',
											mask: true
										})
										setTimeout(function() {
											that.doreload(5)
										}, 1000)
									} else {
										uni.showToast({
											title: '请重试',
											icon: 'loading',
											duration: 1000
										})
									}
								}
							})
						}
					}
				})
			}
		}
	}
</script>
<style>
	@import './wmdd.css';
</style>
<style lang="scss" scoped>
	.u-navbar {

		.u-status-bar,
		.u-navbar__content {
			background: #469BF6 !important;
		}

		::v-deep .u-navbar__content__left {
			display: none !important;
		}
	}

	.main {
		.list-item {
			width: 95%;
			margin: 20rpx auto;
			background: #FFFFFF;
			box-shadow: 0rpx 6rpx 14rpx 0rpx rgba(240, 240, 240, 0.35);
			border-radius: 10rpx;
			box-sizing: border-box;
			font-size: 22rpx;
			padding: 0 20rpx 20rpx 30rpx;
			position: relative;
			.ddbh {
				display: flex;
				align-items: center;
				.status {
					margin-left: auto;
					view {
						color: #469BF6;
					}
				}
				.xp {
					font-size: 20rpx;
					color: #747A7D;
					padding: 4rpx 10rpx;
					border: 1px solid #BCBBBB;
					border-radius: 2rpx;
					margin-left: 20rpx;
				}
			}
			.good-list {
				.goods-item {
					display: flex;
					align-items: center;
					margin-top: 20rpx;
					image {
						width: 70rpx;
						height: 70rpx;
						border-radius: 10rpx;
					}
					.name {
						color: #000000;
						font-size: 26rpx;
						padding-left: 20rpx;
					}
					.money {
						margin-left: auto;
						text {
							display: block;
						}
						.price {
							font-size: 24rpx;
							color: #262827;
						}
						.num {
							text-align: right;
							color: #4E4747;
							font-size: 24rpx;
						}
					}
				}
			}
			.weui-cell:before {
				display: none !important;
			}
			.weui-cell {
				padding: 10rpx 0;
			}
			.tips {
				position: absolute;
				top: 0;
				left: -30rpx;
				background: #FF0000;
				border-radius: 10rpx 0rpx 10rpx 0rpx;
				color: #FFFFFF;
				font-size: 22rpx;
				padding: 4rpx 10rpx;
			}
			.bottom {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 20rpx;
				.left {
					.total {
						view {
							color: #030303;
							font-size: 24rpx;
							text {
								color: #FF0000;
								font-size: 28rpx;
							}
						}
					}
					.time {
						color: #262827;
						font-size: 20rpx;
					}
				}
				.options-btn {
					display: flex;
					button {
						height: 50rpx;
						line-height: 50rpx;
					}
					.jjjd {
						background: #469BF6;
						border-radius: 40rpx;
						margin-right: 20rpx;
						font-size: 24rpx;
					}
					.djjd {
						border: 1px solid #DFDADA;
						border-radius: 40rpx;
						color: #262827;
						font-size: 24rpx;
						background: #fff;
					}
				}
			}
		}
	}
</style>